/**
* @author Meng Zhang
**/

#pragma once
#include <set>
#include "BufferListener.h"
#include "../Helper/HelperMarcos.h"

class BufferBase {
	DISALLOW_COPY_AND_ASSIGN(BufferBase)
public: 
	virtual void AttachListener(BufferListener *listener);
	virtual void DettachListener(BufferListener *listener);
	// virtual bool IsTextBuffer() const;//Just for TextBuffer Ensure save,only a TextBuffer may return true
	virtual ~BufferBase();

protected:
	void BufferBase::Update( BufferListener *listener = NULL );
	BufferBase();

private:
	std::set<BufferListener*> listeners;
};
